import Layout from '@/views/layout/index.vue'

import type { RouteRecordRaw } from 'vue-router'
const routes: RouteRecordRaw[] = [
  {
    path: '/home',
    redirect: '/home/home-admin',
    component: Layout,
    children: [
      {
        path: 'home-admin',
        name: 'homeAdmin',
        meta: {
          title: '首页',
          permission: 'menu:homes',
          icon: 'iconfont icon-shebei'
        },
        component: () => import('@/views/home/index.vue')
      }
    ]
  },
  {
    path: '/deploy-admin',
    redirect: '/deploy-admin/device',
    component: Layout,
    name: 'Tag',
    meta: {
      title: '布控管理',
      icon: 'iconfont icon-guanlianshebei'
    },
    children: [
      {
        path: ':tagId?/device',
        name: 'TagDevice',
        meta: {
          title: '设备布控',
          permission: 'menu:device_deploy',
          icon: 'iconfont icon-shebeiguanli'
        },
        component: () => import('@/views/deployAdmin/TagDevice/index.vue')
      },
      {
        path: ':tagId?/person',
        name: 'TagPerson',
        meta: {
          title: '人员布控',
          permission: 'menu:person_tag',
          icon: 'iconfont icon-renyuanguanli2'
        },
        component: () => import('@/views/deployAdmin/TagPerson/index.vue')
      }
    ]
  }
]

export const appRoutes = [...routes]
